package com.exttech.share.orm.dao;

import java.io.Serializable;
import java.util.List;

/**
 * 抽象Dao
 * User: sidney
 * Date: 12/25/13
 * Time: 22:24
 */
public interface GenericDao<T, PK extends Serializable> {

    public T save(T entity);

    public void update(T entity);

    public void delete(T entity);

    public void delete(PK id);

    public List<T> findAll();

    public T get(PK id);

    public T get(final String sql, final Object... values);

    public List<T> queryList(final String sql, final Object... values);

    public List<T> count(final String sql, final Object... values);

    public List<T> queryList(final String sql, int start, int size, final Object... values);

    public int execute(final String sql, final Object... values);

}
